package singleton;

/**
 * 懒汉式  好处：懒加载  坏处：存在线程安全问题
 * @author Administrator
 *
 */
public class Singleton1 {
	private static Singleton1 instance=null;
	
	private Singleton1(){}
	
	public static Singleton1 getInstance(){
		if( null == instance){
			synchronized (instance) {
				if( null == instance){
					return new Singleton1();
				}
			}
		}
		return instance;
	}
}
